<template>
	<view class="main-box" v-if="!isVerify">
		<view>
			<image id="form-box" mode="widthFix" class="bg-image" :src="imagePath + 'top-bg.png'"></image>
			<view class="count-down-box">
				<sxplus-yl-count-down-time></sxplus-yl-count-down-time>
			</view>
			<view class="main-form-box">
				<sxplus-yl-auto-get-mobile :mobile="formData.mobile" :param="formData.param" :submit="formData.submit"
					:baseImagePath="imagePath" :btnImg="imagePath + 'submit-btn.png'"></sxplus-yl-auto-get-mobile>
			</view>
			<!-- <image mode="widthFix" class="bg-image" :src="imagePath + 'bottom.png'"></image> -->
		</view>

	</view>
	<view v-else style="height: 100vh;display: flex;justify-content: center;align-items: center;color: #00000;">
		该功能暂未开通
	</view>


</template>

<script>
	import httpUtil from "@/utils/httpUtil";
	import userApi from "@/api/userApi.js"
	import commonApi from "@/api/commonApi";
	import logApi from "@/api/logApi.js"

	export default {
		data() {
			return {
				isVerify: false,
				scrollTop: 0,
				imagePath: 'https://h5.sx2b2c.com/images/shengxin_plus/wx_mini/banpin/yinglian/',
				scrollToTargetId: "form-box",
				formData: {
					mobile: '',
					param: '',
					submit: 0,
					intervalId: '',
				}
			}
		},
		onLoad(option) {
			this.initData(option)
		},
		onShow() {},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
		},
		methods: {
			initData(option) {

				// option.a = '000000'
				// option.param = 123456

				logApi.addShengXinPlusYinglianLog('页面加载:' + JSON.stringify(option))

				if (option.a) {
					httpUtil.setA(option.a)
				}
				if (option.param) {
					userApi.setParam(option.param)
				}


				if (option.submit) {
					this.formData.submit = option.submit
				}

				userApi.getMiniLoginCode(code => {
					userApi.initUserId(code, res => {
						commonApi.buriedPoint(57)
					})
				})

				commonApi.isVerify(res => {
					this.isVerify = res
				})
				commonApi.is404()

			},

		}
	}
</script>

<style lang="scss">
	.main-box {
		background-color: #FAEED4;
		min-height: 100vh;
		padding-bottom: 20rpx;
	}

	.main-form-box {
		width: 90%;
		// position: absolute;
		// left: 5%;
		// bottom: 10vh;
		margin: 60rpx auto 0;
	}

	.bg-image {
		width: 100%;
		height: auto;
	}
</style>